<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('销售出库列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>单据编号：</label>
                                <input type="text" name="chukuDanhao"/>
                            </li>
                            <li>
                                <label>销售日期：</label>
                                <input type="text" class="time-input" placeholder="请选择销售日期" name="chukuDate"/>
                            </li>
                            <li>
                                <label>付款方式：</label>
                                <select name="paymentMethod" th:with="type=${@dict.getType('sys_pay')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>出货仓库：</label>
                                <input type="text" name="chukuCangku"/>
                            </li>
                            <li>
                                <label>门扇名称：</label>
                                <input type="text" name="goodNameMen"/>
                            </li>
                            <li>
                                <label>门框名称：</label>
                                <input type="text" name="goodNameKuang"/>
                            </li>
                            <li>
                                <label>销售单价：</label>
                                <input type="text" name="chukuDanjia"/>
                            </li>
                            <li>
                                <label>备注：</label>
                                <input type="text" name="beizhu"/>
                            </li>
                            <li>
                                <label>墙厚：</label>
                                <input type="text" name="qianghou"/>
                            </li>
                            <li>
                                <label>实际生产宽：</label>
                                <input type="text" name="sjsckuan"/>
                            </li>
                            <li>
                                <label>实际生产高：</label>
                                <input type="text" name="sjscgao"/>
                            </li>
                            <li>
                                <label>五金数量：</label>
                                <input type="text" name="wujing"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

            <div class="btn-group-sm" id="toolbar" role="group">
                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="xiaoshouchuku:chukuTest:add">
                    <i class="fa fa-plus"></i> 添加
                </a>
                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="xiaoshouchuku:chukuTest:edit">
                    <i class="fa fa-edit"></i> 修改
                </a>
                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="xiaoshouchuku:chukuTest:remove">
                    <i class="fa fa-remove"></i> 删除
                </a>
                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="xiaoshouchuku:chukuTest:export">
                    <i class="fa fa-download"></i> 导出
                </a>
            </div>
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('xiaoshouchuku:chukuTest:edit')}]];
        var removeFlag = [[${@permission.hasPermi('xiaoshouchuku:chukuTest:remove')}]];
        var paymentMethodDatas = [[${@dict.getType('sys_pay')}]];
        var prefix = ctx + "xiaoshouchuku/chukuTest";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "销售出库",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '编号',
                    visible: false
                },
                {
                    field: 'chukuDanhao',
                    title: '单据编号'
                },
                {
                    field: 'chukuDate',
                    title: '销售日期'
                },
                {
                    field: 'paymentMethod',
                    title: '付款方式',
                    formatter: function(value, row, index) {
                       return $.table.selectDictLabel(paymentMethodDatas, value);
                    }
                },
                {
                    field: 'chukuCangku',
                    title: '出货仓库'
                },
                {
                    field: 'goodNameMen',
                    title: '门扇名称'
                },
                {
                    field: 'tupian',
                    title: '门扇图片'
                },
                {
                    field: 'MenShuliang',
                    title: '门扇数量'
                },
                {
                    field: 'goodNameKuang',
                    title: '门框名称'
                },
                {
                    field: 'tupian2',
                    title: '门框图片'
                },
                {
                    field: 'KuangShuliang',
                    title: '门框数量'
                },
                {
                    field: 'chukuDanjia',
                    title: '销售单价'
                },
                {
                    field: 'beizhu',
                    title: '备注'
                },
                {
                    field: 'peitao',
                    title: '配套类型'
                },
                {
                    field: 'qianghou',
                    title: '墙厚'
                },
                {
                    field: 'sjsckuan',
                    title: '实际生产宽'
                },
                {
                    field: 'sjscgao',
                    title: '实际生产高'
                },
                {
                    field: 'wujing',
                    title: '五金数量'
                },
                {
                    field: 'zhonjine',
                    title: '总金额'
                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
                        return actions.join('');
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>